package net.guerlab.sdk.anubis;

import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;

import net.guerlab.sdk.anubis.helper.NotifyHelper;

/**
 * 异步通知 demo
 * 
 * @author guer
 *
 */
public class NotifyDemo {

    private static final String BODY = "data=%7B%22open_order_code%22%3A%22-1%22%2C%22partner_order_code%22%3A%2212345678%22%2C%22order_status%22%3A5%2C%22push_time%22%3A1510144817522%2C%22carrier_driver_name%22%3Anull%2C%22carrier_driver_phone%22%3Anull%2C%22cancel_reason%22%3Anull%2C%22platform_code%22%3Anull%2C%22description%22%3A%22%E8%AE%A2%E5%8D%95%E9%85%8D%E9%80%81%E8%B7%9D%E7%A6%BB%E5%A4%AA%E8%BF%9C%E4%BA%86%E8%B6%85%E8%BF%87%E9%98%88%E5%80%BC%22%2C%22tracking_id%22%3Anull%2C%22error_code%22%3A%22OVER_RANGE_MAX_DISTANCE_ERROR%22%2C%22station_name%22%3Anull%2C%22station_tel%22%3Anull%7D";

    @Test
    public void test() throws Exception {

        ObjectMapper objectMapper = new ObjectMapper();

        NotifyHelper notifyHelper = new NotifyHelper();
        notifyHelper.setObjectMapper(objectMapper);

        System.out.println(notifyHelper.parse(BODY));
    }
}
